package AddressGoods;

import control.Goods;
import utils.DBUtils;

import java.util.ArrayList;
import java.util.List;

public class AddressGoodsDAO implements IAddressGoodsDAO{
    public int insert(Goods goods){
        String sql="insert into tb_goods values(null,?,?,?,?)";
        List<Object> list=new ArrayList();
        //list.add(goods.getGoodsId());
        list.add(goods.getGoodsName());
        list.add(goods.getGoodsType());
        list.add(goods.getPrice());
        list.add(goods.getInventory());
        int i=DBUtils.executeUpdate(sql,list);
        return i;
    }

    @Override
    public Goods findgood(String name) {
        return null;
    }

    @Override
    public int deletegood(String name) {
        return 0;
    }


    @Override
    public int updategood(Goods goods) {
        return 0;
    }
}
